package com.ant.storage.controller;

import com.ant.storage.common.ResultPage;
import com.ant.storage.pojo.LossReporting;
import com.ant.storage.service.ILossReportingService;
import com.ant.storage.common.PageRecv;
import com.ant.storage.common.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/lossReporting")
@Api(tags = "报损接口")
public class LossReportingController {

    @Autowired
    ILossReportingService lossReportingService;

    @ApiOperation(value = "添加报损单")
    @PostMapping("/addLossReporting")
    public ResultVo addLossReporting(@RequestBody LossReporting lossReporting) throws NoSuchFieldException {
        return lossReportingService.addLossReporting(lossReporting);
    }

    @ApiOperation(value = "查询报损单")
    @PostMapping("/queryLossReporting")
    public ResultPage queryLossReporting(@RequestBody PageRecv<LossReporting>pageRecv) throws NoSuchFieldException {
        return lossReportingService.queryLossReporting(pageRecv);
    }
}
